import request from '@/utils/request'

export function add(data) {
  console.log(data)
  return request({
    url: 'api/itrms/project/soft/'+data['projectId'],
    method: 'post',
    data: data['softIds']
  })
}

export function del(projectId,serverId) {
  return request({
    url: 'api/itrms/project/soft/'+projectId,
    method: 'delete',
    data: [serverId]
  })
}

export function edit(data) {
  return request({
    url: 'api/itrms/project/soft',
    method: 'put',
    data
  })
}

export function getUnAllocate(projectId) {
  return request({
    url: 'api/itrms/project/soft/'+projectId,
    method: 'get',
    params: {
      status: 2,
      allocated: false
    }
  })
}

export default { add, edit, del,getUnAllocate }
